package com.zzl.finance.data.constant;

/**
 * @author by gull
 * @Classname 是否时黑名单 0否 1是
 * @Description 类型字典值
 * @Date 2020/11/9 12:30
 */
@SuppressWarnings("javadoc")
public enum BlackListTypeEnum {

    /**
     *
     */
    BLACK_LIST_TYPE(1, "黑名单"),
    WHITE_LIST_TYPE(0, "白名单"),
    ;


    private Integer key;
    private String value;

    BlackListTypeEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    /**
     * 通过code获取枚举对象
     *
     * @param code code值
     * @return 枚举对象
     */
    public static String getStatus(Integer code) {
        for (BlackListTypeEnum value : BlackListTypeEnum.values()) {
            if (value.key.equals(code)) {
                return value.value;
            }
        }
        return null;
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }
}
